package org.intrasearch.spider;

import org.hamcrest.Description;
import org.hamcrest.TypeSafeMatcher;
import org.intrasearch.core.DirectoryArtifact;

public class DirectoryArtifactMatcher extends TypeSafeMatcher<DirectoryArtifact>
{
    private final String artifactName;

    public DirectoryArtifactMatcher(String artifactName)
    {
        this.artifactName = artifactName;
    }

    public void describeTo(Description description)
    {
        description.appendText(artifactName);
    }

    @Override
    public boolean matchesSafely(DirectoryArtifact directoryArtifact)
    {
        return artifactName.equals(directoryArtifact.getName());
    }
}
